package com.example.back.controller;

import com.example.back.model.Accommodation;
import com.example.back.model.Route;
import com.example.back.service.AccommodationService;
import com.example.back.service.RouteService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : 贾媛晴
 * @createTime : 2022/5/2 14:09
 */
@RestController
@Api(tags = "RouteController")
@CrossOrigin //允许跨域
public class RouteController {

    @Autowired
    RouteService routeService;

    @GetMapping("/Route")
    public List<Route> selectAll(){
        List<Route> routeList = this.routeService.selectAll();
        return routeList;
    }

    // 取出 详情页 的数据
    @GetMapping("/Route_Detail")
    public Route selectDetail(String itemId){
        Route detail=this.routeService.selectDetail(itemId);
        return detail;
    }
}
